package com.example.customview;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

public class MainActivity extends AppCompatActivity {
    
    //ui
    private LinearLayout llRoot;
    private TestViewOne testViewOne;
    private TestViewTwo testViewTwo;
    private  TestViewThree testViewThree;
//    private MyView myView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        myView = findViewById(R.id.my_view);


        initViews();
    }

    private void initViews() {
        llRoot = findViewById(R.id.ll_root_main);

        testViewTwo = findViewById(R.id.tv_test_two_main);
        testViewTwo.setTitle("test two title");
        testViewTwo.setMessage("test two message");

        testViewThree = findViewById(R.id.tv_test_three_main);
        testViewThree.setTitle("test three title");
        testViewThree.setMessage("test three message");

        testViewOne = (TestViewOne) LayoutInflater.from(this).inflate(R.layout.view_test_one,null,false);
        testViewOne.setTitle("test one title");
        testViewOne.setMessage("test one message");

        llRoot.addView(testViewOne);





    }
}